package cn.swu.Waimai.logic.dao

import android.content.Context
import android.database.sqlite.SQLiteDatabase
import android.database.sqlite.SQLiteOpenHelper

class LoginHelper(val context: Context, name: String, version: Int): SQLiteOpenHelper(context, name, null, version)  {
    private val createLogin = "create table Login ( "+
            "id integer primary key autoincrement, "+
            "phone text," +
            "password text)"
    override fun onCreate(db: SQLiteDatabase?) {
        db?.execSQL(createLogin)
    }

    override fun onUpgrade(db: SQLiteDatabase?, oldVersion: Int, newVersion: Int) {
        db?.execSQL("drop table if exists Login")
        onCreate(db)
    }
}